﻿////#include<stdio.h>
////#include"Queue.h"
////#include"Stack.h"
//
////void Swap(int* p, int* q)
////{
////	int tmp = *p;
////	*p = *q;
////	*q = tmp;
////}
////void ShellSort(int* a, int n)
////{
////	int gap = n;
////	while (gap > 1)
////	{	
////		//+1保证最后一次gap是1
////		//gap>1时，是预排序
////		//gap=1时，是插入排序
////		gap = gap / 3 + 1;
////		for (int i = 0; i < n - gap; i++)
////		{
////			int end = i;
////			int tmp = a[end + gap];
////			while (end >= 0)
////			{
////				if (a[end] > tmp)
////				{
////					a[end + gap] = a[end];
////					end -= gap;
////				}
////				else
////					break;
////			}
////			a[end + gap] = tmp;
////		}
////	}
////}
////void InsertSort(int* a, int n)
////{
////	for (int i = 0; i < n - 1; i++)
////	{
////		int end = 0;
////		int tmp = a[end + 1];
////		while (end >= 0)
////		{
////			if (a[end] > tmp)
////			{
////				a[end + 1] = a[end];
////				end--;
////			}
////			else
////			{
////				break;
////			}
////		}
////		//代码到这个位置有两种情况
////		//1、数组已经是有序。
////		//2、end结束循环后，end<0还未进行插入。
////		a[end + 1] = tmp;
////	}
////}
////void SleceSort(int* a, int n)
////{
////	int begin = 0, end = n - 1;
////	while (begin < end)
////	{
////		//单趟排序
////		int max = begin, min = begin;
////		for (int i = begin + 1; i <=end; i++)
////		{
////			if (a[min] > a[i])
////			{
////				min = i;
////			}
////			if (a[max] < a[i])
////			{
////				max = i;
////			}
////		}
////		Swap(&a[min], &a[begin]);
////		if (begin == max)
////			max = min;
////		Swap(&a[max], &a[end]);
////		--end;
////		++begin;
////	}
////	
////	
////}
////
//////快速排序
////int Getmid(int* a, int left, int right)
////{
////	int midi = (right + left) / 2;
////	if (a[left] < a[midi])
////	{
////		if (a[midi] < a[right])
////		{
////			return midi;
////		}
////		else if (a[right] > a[left])
////		{
////			return left;
////		}
////		else
////		{
////			return right;
////		}
////	}
////	else//a[left] > a[midi]
////	{
////		if (a[midi] > a[right])
////		{
////			return midi;
////		}
////		else if (a[right] > a[left])
////		{
////			return left;
////		}
////		else {
////			return right;
////		}
////	}
////}
//////hoare排序
////int PartSort1(int* a, int left, int right)
////{
////	int midi = Getmid(a, left, right);
////	Swap(&a[left], &a[midi]);
////
////	int key = left;
////	int begin = left, end = right;
////	while (end > begin)
////	{
////		//右找小
////		while (end > begin && a[end] >= a[key])//重要
////		{
////			end--;
////		}
////		//左找大
////		while (begin < end && a[begin] <= a[key])
////		{
////			begin++;
////		}
////		Swap(&a[begin], &a[end]);
////	}
////	Swap(&a[end], &a[key]);
////	return begin;
////}
//////挖坑法
////int PartSort2(int* a, int left, int right)
////{
////	int key = a[left];
////	int begin = left, end = right;
////	while (begin < end)
////	{
////		//右找小
////		while (begin < end && a[end] >= key)
////			end--;
////		a[begin] = a[end];
////		while (begin < end && a[begin] <= key)
////			begin++;
////		a[end] = a[begin];
////	}
////	a[begin] = key;
////	return begin;
////}
//////前后指针
////int PartSort3(int* a, int left, int right)
////{
////	// 三数取中
////	int midi = Getmid(a, left, right);
////	Swap(&a[left], &a[midi]);
////	int key = left;
////
////	int prev = left;
////	int cur = prev + 1;
////	while (cur <= right)
////	{
////		if (a[cur] < a[key] && ++prev != cur)
////			Swap(&a[prev], &a[cur]);
////
////		cur++;
////	}
////
////	Swap(&a[prev], &a[key]);
////	return prev;
////}
//////大逻辑
////void QuickSort(int* a, int left, int right)
////{
////	if (left >= right)
////		return;
////	if ((right - left) + 1 < 10)
////	{
////		InsertSort(a + left, right - left + 1);
////	}
////	else
////	{
////		//hoare法
////		int keyi = PartSort1(a, left, right);
////		//挖坑法
////		//int keyi = PartSort2(a, left, right);
////		//指针法
////		int keyi = PartSort3(a, left, right);
////
////		// [left, keyi-1] keyi [keyi+1, right]
////		QuickSort(a, left, keyi - 1);
////		QuickSort(a, keyi + 1, right);
////	}
////
////}
////
//////归并排序
////void _MergeSort(int* a, int* tmp, int begin, int end)
////{
////	if (begin >= end)
////	{
////		return;
////	}
////	int mid = (begin + end) / 2;
////	//[begin, mid][mid+1,end]
////	
////	_MergeSort(a, tmp, begin, mid);
////	_MergeSort(a, tmp, mid+1, end);
////	int begin1 = begin, end1 = mid;
////	int begin2 = mid + 1, end2 = end;
////	int i = begin;
////	while (begin1 <= end1 && begin2 <= end2)
////	{
////		if (a[begin1] < a[begin2])
////		{
////			tmp[i++] = a[begin1++];
////		}
////		else
////		{
////			tmp[i++] = a[begin2++];
////		}
////	}
////	while (begin1 <= end1)
////	{
////		tmp[i++] = a[begin1++];
////	}
////	while (begin2 <= end2)
////	{
////		tmp[i++] = a[begin2++];
////	}
////
////	memcpy(a + begin, tmp + begin, sizeof(int) * (end - begin + 1));
////}
////void MergeSort(int* a, int n)
////{
////	int* tmp = (int*)malloc(sizeof(int) * n);
////	if (tmp == NULL)
////	{
////		perror("malloc is error");
////		return;
////	}
////	_MergeSort(a, tmp, 0, n - 1);
////
////	free(tmp);
////	tmp = NULL;
////}
////void MergeSortNonR(int* a, int n)
////{
////	int* tmp = (int*)malloc(sizeof(int) * n);
////	if (tmp == NULL)
////	{
////		perror("malloc fail");
////		return;
////	}
////	
////	// gap每组归并数据的数据个数
////	int gap = 1;
////	while (gap < n)
////	{
////		for (int i = 0; i < n; i += 2 * gap)
////		{
////			// [begin1, end1][begin2, end2]
////			int begin1 = i, end1 = i + gap - 1;
////			int begin2 = i + gap, end2 = i + 2 * gap - 1;
////
////			printf("[%d,%d][%d,%d] ", begin1, end1, begin2, end2);
////
////			// 第二组都越界不存在，这一组就不需要归并
////			if (begin2 >= n)
////				break;
////
////			// 第二的组begin2没越界，end2越界了，需要修正一下，继续归并
////			if (end2 >= n)
////				end2 = n - 1;
////
////			int j = i;
////			while (begin1 <= end1 && begin2 <= end2)
////			{
////				if (a[begin1] < a[begin2])
////				{
////					tmp[j++] = a[begin1++];
////				}
////				else
////				{
////					tmp[j++] = a[begin2++];
////				}
////			}
////
////			while (begin1 <= end1)
////			{
////				tmp[j++] = a[begin1++];
////			}
////
////			while (begin2 <= end2)
////			{
////				tmp[j++] = a[begin2++];
////			}
////
////			memcpy(a + i, tmp + i, sizeof(int) * (end2 - i + 1));
////		}
////
////		printf("\n");
////
////		gap *= 2;
////	}
////
////	free(tmp);
////	tmp = NULL;
////}
////void PrintArry(int* a,int n)
////{
////	for (int i = 0; i < n; i++)
////	{
////		printf("%d ", a[i]);
////	}
////}
////void TestShellSort()
////{
////	int a[] = { 9,1,2,5,7,4,8,6,3,5 };
////	ShellSort(a, sizeof(a) / sizeof(a[0]));
////	PrintArry(a, sizeof(a) / sizeof(a[0]));
////}
////void TestQuickSort()
////{
////	int a[] = { 6,1,2,7,9,3,4,5,10,8 };
////	QuickSort3(a, 0, sizeof(a) / sizeof(a[0]) - 1);
////	PrintArry(a, sizeof(a) / sizeof(a[0]));
////}
////void TestMergeSort()
////{
////	int a[] = { 10,6,7,1,3,9,4,2 };
////	MergeSort(a, sizeof(a) / sizeof(a[0]));
////	PrintArry(a, sizeof(a) / sizeof(a[0]));
////}
////int main()
////{
////	 
////	//TestSleceSort();
////	//TestQuickSort();
////	TestMergeSort();
////	return 0;
////}
////
////
////
//// struct ListNode {
////	int val;
////	struct ListNode* next;
////};
//// struct ListNode* ReverseList(struct ListNode* head)
//// {
////	 // write code here
////	 if (head == NULL)
////		 return head;
////	 struct ListNode* n1 = NULL;
////	 struct ListNode* n2 = head;
////	 struct ListNode* n3 = n2->next;
////	 while (n2->next == NULL)
////	 {
////		 n1 = n2;
////		 n2 = n3;
////		 if (n3 != NULL)
////			 n3 = n3->next;
////		 n2->next = n1;
////	 }
////	 return n1;
//// }
////int main()
////{
////	struct ListNode st;
////
////	ReverseList(&st);
////	return 0;
////}
////
////#define _CRT_SECURE_NO_WARNINGS 1
//
////#include<iostream>
////#include<stdlib.h>
////using namespace std;
////namespace bit
////{
////	int rand = 10;
////}
////int main()
////{
////	int rand = 10;
////	cout << bit::rand << endl;
//// return 0;
////}
////namespace MyNamespace
////{
////	int add(int a, int b)
////	{
////		return a + b;
////	}
////	 struct Node
////	{
////		struct Node* next;
////		int data;
////	};
////	 int i = 10;
////}
//////项⽬⼯程中多⽂件中定义的同名namespace会认为是⼀个namespace，不会冲突。
////namespace MyNamespace
////{
////	int i = 10;
////}
////namespace MyNamespace
////{
////	int j = 10;
////}
////int main()
////{
////	printf("%d", MyNamespace::i);
////
////}
////#include<iostream>
////#include<stdio.h>
////int i = 20;
////namespace MyNamespace
////{
////	int i = 10;
////	int Add(int a, int b)
////	{
////		return a + b;
////	}
////	struct Node
////	{
////		Node* next;
////		int data;
////	};
////}
////int main()
////{
////	printf("%d", ::i);
////	printf("%d", MyNamespace::i);
////	int ret = MyNamespace::Add(1, 2);
////	struct MyNamespace::Node st;
////	return 0;
////}
////#include<iostream>
////namespace QQ
////{
////	int a = 10;
////	int b = 20;
////}
//////指定命名空间访问
////int main()
////{
////	printf("%d\n", QQ::a);
////	return 0;
////}
//////using将命名空间中某个成员展开
////using	QQ::a;
////int main()
////{
////	printf("%d\n", a);
////	printf("%d\n", QQ::b);
////} // 
//////展开命名空间中全部成员
////using namespace QQ;
////int main()
////{
////	printf("%d\n", a);
////	printf("%d\n", b);
////	return 0;
////}
////namespace A
////{
////	namespace xiaosun
////	{
////		int i = 10;
////	}
////	namespace xiaomin
////	{
////		int a = 10;
////	}
////}
////int main()
////{
////	printf("%d", A::xiaomin::a);
////	printf("%d", A::xiaosun::i);
////	return 0;
////}
//
////#include<iostream>
////using namespace std;
////
//////全缺省
////void Func1(int a = 100, int b = 200, int c = 300)
////{
////	cout << "a =" << a << endl;
////	cout << "b =" << b << endl;
////	cout << "c =" << c << endl;
////}
//////半缺省
////void Func2(int a, int b = 200, int c = 300)
////{
////	cout << "a =" << a << endl;
////	cout << "b =" << b << endl;
////	cout << "c =" << c << endl;
////}
////
////int main()
////{
////	//全缺省参数
////	Func1();//不传参数
////	cout << endl;
////	Func1(10,20);//传一部分参数
////	cout << endl;
////	Func1(10,20,30);//全传
////
////	//半缺省
////	Func2(10,20);//传一部分参数
////	cout << endl;
////	Func2(10,20,30);//全传
////	return 0;
////}
////#include<iostream>
////using namespace std;
////
//////参数类型不同
////int  Sub(int num1, int num2)
////{
////	cout << "int Sub(int num1, int num2)" << endl;
////	return num1 - num2;
////}
////double  Sub(double num1, double num2)
////{
////	cout << "double Sub(double num1, double num2)" << endl;
////	return num1 - num2;
////}
////
//////参数个数不同
////void Func()
////{
////	cout << "Func()" << endl;
////}
////void Func(int a)
////{
////	cout << "Func(int a)" << endl;
////}
//////参数类型顺序不同
////void Func(int a, char b)
////{
////	cout << "Func(int a, char b)" << endl;
////}
////void Func(char b, int a)
////{
////	cout << "Func(char b, int a)" << endl;
////}
////void fxx()
////{}
////int fxx()
////{
////     
////	return 0;
////}
////
////void f1()
////{
////	cout << "f()" << endl;
////} 
////void f1(int a = 10)
////{
////	cout << "f(int a)" << endl;
////}
////#include<iostream>
////using namespace std;
////class Stack {
////public:
////    void Init(int n = 4)
////    {
////       arr = (int*)malloc(sizeof(int) * n);
////        if (nullptr == arr)
////        {
////            perror("malloc申请空间失败");
////            return;
////        }
////        capacity = n;
////        top = 0;
////    }
////private:
////    // 成员变量
////    int* arr;
////    size_t capacity;
////    size_t top;
////};
////class A
////{
////public:
////	A()
////	{
////		++_scount;
////	}
////
////	A(const A& t)
////	{
////		++_scount;
////	}
////
////	~A()
////	{
////		--_scount;
////	}
////
////	static int GetACount()
////	{
////		//_a++;
////		return _scount;
////	}
////
////	void func()
////	{
////		cout << _scount << endl;
////		cout << GetACount() << endl;
////	}
////
////private:
////	// 类里面声明
////	static int _scount;
////
////
////	int _a = 1;
////};
////
////// 类外面初始化
////int A::_scount = 0;
////
////int main()
////{
////	//cout << A::_scount << endl;
////	//cout << sizeof(A) << endl;
////
////	cout << A::GetACount() << endl;
////	A a1, a2;
////
////	{
////		A a3(a1);
////		cout << A::GetACount() << endl;
////	}
////
////	cout << A::GetACount() << endl;
////	cout << a1.GetACount() << endl;
////
////	return 0;
////}
//// //struct List
////{
////	int val;
////	List* next;
////};
//
//
////class Date
////{
////public:
////	//成员函数
////	void Init(int year = 1, int month = 1, int day = 1);
////private:
////	//成员变量
////	int _year;
////	int _month;
////	int _day;
////};
////声明和定义分离，需要指定类域
////这里是☞Date这个类域下的Init函数
////void Date::Init(int year , int month , int day )
////{
////	_year = year;
////	_month = month;
////	_day = day;
////}
////int main()
////{
////	//Date d1;
////	//Date d2;
////	//Date d3;
////	//Date d4;
////	cout << sizeof(Date);
////	return 0;
////}
////#include<iostream>
////using namespace std;
////class A
////{
////public:
////	void print()
////	{
////		cout << " print()" << endl;
////	}
////private:
////	char a1;
////	int a2;
////};
////class	B
////{
////public:
////	void print()
////	{
////		cout << " print()" << endl;
////	}
////};
////class C
////{
////};
////class D
////{
////public:
////	class E{
////		int b;
////	};
////private:
////	int a;
////};
////int main()
////{
////	A a;
////	B b;
////	C c;
////	D d;
////	cout << sizeof(a) << endl;
////	cout << sizeof(b) << endl;
////	cout << sizeof(c) << endl;
////	cout << sizeof(d) << endl;
////	return 0;
////} 
////#include<iostream>
////using namespace std;
////class QiuQiu
////{
////public:
////	QiuQiu (int age, int height, int weight)
////	{
////		_age = age;
////		this->_height = height;
////		this->_weight = weight;
////	}
////	void Print()
////	{
////		cout << "年龄：" << _age <<"岁" << endl;
////		cout << "身高：" << _height << "厘米" << endl;
////		cout << "体重：" << _weight << "千克" << endl << endl;;
////	}
////
////private:
////	int _age;
////	int _height;
////	int _weight;
////};
////int main()
////{
////	QiuQiu q1(20,180,65);
////	q1.Print();
////	cout << endl;
////	QiuQiu q2 (15,170,55);
////	q2.Print();
////	return 0;
////}
////#include<iostream>
////using namespace std;
////class A
////{
////public:
////	void Print()
////	{
////		cout << "A::Print()" << endl;
////	}
////private:
////	int _a;
////};
////int main()
////{
////	A* p = nullptr;
////	p->Print();
////	return 0;
////}
//// 
//// 
////
////#include<iostream>
////using namespace std;
////class Date
////{
////public:
////	void Init(int year, int month, int day)
////	{
////		_year = year;
////		_month = month;
////		_day = day;
////	}
////	void Print()
////	{
////		cout << _year << "/" << _month << "/" << _day << endl;
////	}
////private:
////	int _year;
////	int _month;
////	int _day;
////};
////int main()
////{
////	Date d1;
////	d1.Init(2024, 7, 20);
////	d1.Print();
////	return 0;
////}
////#include<iostream>
////using namespace std;
////class Date
////{
////public:
////	// 1.⽆参构造函数
////	//Date()
////	//{
////	//	_year = 1;
////	//	_month = 1;
////	//	_day = 1;
////	//}
////	// 2.带参构造函数
////	Date(int year, int month, int day)
////	{
////		_year = year;
////		_month = month;
////		_day = day;
////	}
////	// 3.全缺省构造函数
////	Date(int year = 1, int month = 1, int day = 1)
////	{
////		 _year = year;
////		 _month = month;
////		 _day = day;
////	}
////	void Print()
////	{
////		cout << _year << "/" << _month << "/" << _day << endl;
////	}
//// private:
////	 int _year;
////	 int _month;
////	 int _day;
//// };
//// int main()
//// {
////	 // 如果留下三个构造中的第⼆个带参构造，第⼀个和第三个注释掉
////	// 编译报错：error C2512: “Date”: 没有合适的默认构造函数可⽤
////	//Date d1;             
////	// 调⽤默认构造函数
////	Date d2(2025, 1, 1); 
////	// 调⽤带参的构造函数
////	// 注意：如果通过⽆参构造函数创建对象时，对象后⾯不⽤跟括号，否则编译器⽆法
////	// 区分这⾥是函数声明还是实例化对象
////	// warning C4930: “Date d3(void)”: 未调⽤原型函数(是否是有意⽤变量定义的?)
////	 //Date d3();
////	 //d1.Print();
////	 d2.Print();
////	 return 0;
////}
////#include<string>
////#include<iostream>
////#include <list>
////#include <iostream>
////using namespace std;
////
////int date(int year, int month)
////{
////    int monthday[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
////    if (month == 2 && (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)))
////        return 29;
////    return monthday[month];
////}
////int main() {
////    int year, month, day;
////    cin >> year >> month >> day;
////    int sum = day;
////
////    while (month > 0)
////    {
////        month--;
////        sum = sum + date(year, month);
////    }
////    cout << sum;
////    return 0;
////}
//// #include <iostream>
////using namespace std;
////int date(int year, int month)
////{
////    int monthday[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
////    if (month == 2 && (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)))
////        return 29;
////    return monthday[month];
////}
////
////void swap(int& p, int& q)
////{
////    int tmp = p;
////    p = q;
////    q = tmp;
////}
////bool ismax(int year1, int month1, int day1, int year2, int month2, int day2)
////{
////    if (year1 > year2)
////        return true;
////    else if (year1 == year2)
////    {
////        if (month1 > month2)
////            return true;
////        else if (month1 == month2)
////        {
////            if (day1 > day2)
////                return true;
////        }
////    }
////    return false;
////}
////int main() {
////    int year1, month1, day1;
////    int year2, month2, day2;
////    cin >> year1 >> month1 >> day1;
////    cin >> year2 >> month2 >> day2;
////    if (!ismax(year1, month1, day1, year2, month2, day2))
////    {
////        swap(year1, year2);
////        swap(month1, month2);
////        swap(day1, day2);
////    }
////    int count = 0;
////    while (year1 != year2 || month1 != month2 || day1 != day2)
////    {
////        ++count;
////        ++day2;
////        if (day2 > date(year2, month2))
////        {
////            day2 = 1;
////            month2++;
////            if (month2 > 12)
////            {
////                month2 = 1;
////                year2++;
////            }
////        }
////    }
////    cout << count;
////    return 0;
////}
//// 64 位输出请用 printf("%lld")
////void test()
////{
////	string s1;
////	string s2("hello world");
////	
////	cout << s1 << s2 << endl;
////
////	s2[3] = 'S';
////	cout << s1 << s2 << endl;
////
////	//1,下标
////	for (size_t i = 0; i < s2.size(); i++)
////	{
////		cout << s2[i] << " ";
////	}
////	cout << endl;
////
////	//2,迭代器
////	//string::iterator it = s2.begin();
////	auto it = s2.begin();
////	while (it != s2.end())
////	{
////		*it += 2;
////		cout << *it << " ";
////		++it;
////	}
////	cout << endl;
////
////
////	// 3、字符赋值，自动迭代，自动判断结束
////	// 底层就是迭代器
////	//for (auto& ch : s2)
////	for (auto ch : s2)//ch是 it的拷贝，修改只是局部变量；
////	{
////		ch -= 2;
////		cout << ch << " ";
////	}
////	cout << endl;
////	cout << s2 << endl;
////
////	//list<int> It = { 1,2,3,4,5,6,7,8 };
////	//list<int>::iterator lit = It.begin();
////	//while (lit != It.end())
////	//{
////	//	cout << *lit << " ";
////	//	++lit;
////	//}
////	//cout << endl;
////
////
////}
////
////int main()
////{
////	test();
////	return 0;
////}int globalVar = 1;
////void test1()
////{
////	string s1("hello world");
////	string s2 = { "hello bit" };
////	cout << s1 << endl;
////	string::iterator It = s1.begin();
////	while (It != s1.end())
////	{
////		*It += 2;
////		cout << *It << " ";
////		++It;
////	}
////	cout << endl;
////
////	//逆序打印
////	string::reverse_iterator rit = s2.rbegin();
////	while (rit != s2.rend())
////	{
////		cout << *rit << " ";
////		++rit;
////	}
////	cout << endl;
////
////	cout << s1 << endl;
////	cout << s2 << endl;
////	const string s3("hello world");
////	//string::const_iterator cit  = s3.begin();
////	auto cit = s3.begin();
////	while (cit != s3.end())
////	{
////		cout << *cit << " ";
////		++cit;
////	}
////	cout << endl;
////
////	auto rcit = s3.rbegin();
////	while (rcit != s3.rend())
////	{
////		cout << *rcit << " ";
////		++rcit;
////	}
////}
////void test2()
////{
////	//string str("hello world");
////	//for (auto it = str.cbegin(); it != str.cend(); ++it)
////	//cout << *it;
////	string s1("hello qiuqiu");
////	cout << s1.capacity() << endl;
////	s1.reserve(100);
////	size_t sz = s1.capacity();
////	cout << "capacity changed: " << sz << '\n';
////	
////	for (int i = 0; i < 100; ++i)
////	{
////		s1.push_back('c');
////		if (sz = s1.capacity())
////		{
////			sz = s1.capacity();
////			cout << "capacity changed: " << sz << '\n';
////		}
////	}
////}
////void test3()
////{
////	string s1("hello qiuqiu");
////	cout << s1.length() << endl;
////	cout << s1.size() << endl;
////
////	cout << s1.max_size() << endl;
////	cout << s1.capacity() << endl;
////}
////void test4()
////{
////	string s2 = { "hello zhuangshimian" };
////	cout << s2.size() << endl;
////	cout << s2.capacity() << endl << endl;
////
////	s2.reserve(20);
////	cout << s2.size() << endl;
////	cout << s2.capacity() << endl << endl;
////
////	s2.reserve(28);
////	cout << s2.size() << endl;
////	cout << s2.capacity() << endl << endl;
////
////	s2.reserve(40);
////	cout << s2.size() << endl;
////	cout << s2.capacity() << endl << endl;
////
////	s2.clear();
////	cout << s2.size() << endl;
////	cout << s2.capacity() << endl << endl;
////
////	cout << typeid(string::iterator).name() << endl;
////	cout << typeid(string::reverse_iterator).name() << endl;
////}
////void test5()
////{
////	string s1("hello world");
////	s1.push_back('x');
////	cout << s1 << endl;
////	s1.insert(0, "hello bit ");//前第0插入；
////	cout << s1 << endl;
////
////	char ch = 't';
////	s1.insert(0, 1, ch);
////	cout << s1 << endl;
////
////	s1.insert(s1.begin(), ch);
////	cout << s1 << endl;
////
////}
////void 	test6()
////{
////	string s("hello world");
////
////	//头删
////	s.erase(0, 1);//
////	cout << s << endl;
////
////	s.erase(s.begin());
////	cout << s << endl;
////	
////	// 尾删
////	s.erase(--s.end());
////	cout << s << endl;
////
////	s.erase(s.size() - 1, 1);
////	cout << s << endl;
////
////	string ss("hello world");
////	ss.erase(6);
////	cout << ss << endl;
////
////	string sss("hello world haha");//打印 hello haha
////	sss.erase(6, 5);
////	cout << sss << endl;
////
////}
////int main()
////{
////	//test1();
////	//test2();
////	//test3();
////	//test4();
////	//test5();
////	test6();
////	return 0;
////}
//
////class Date		
////{
////public:
////	Date(int year,int month, int day)
////	{
////		cout << " Date(int year, int month, int day) " << endl;
////		_year = year;
////		_month = month;
////		_day = day;
////	}
////	~Date()
////	{
////		cout << " ~Date()" << endl;
////	}
////private:
////	int _year;
////	int _month;
////	int _day;;
////};
////int main()
////{
////	Date d1(2024,7,7);
////	return 0;
////}
//
////class Date
////{
////public:
////	////构造函数
////	//Date(int year =1, int month=1, int day=1)
////	//{
////	//		_year = year;
////	//		_month = month;
////	//		_day = day;
////	//}
////	//拷贝构造函数
////	Date(const Date  d)
////	{
////		_year = d._year;
////		_month = d._month;
////		_day = d._day;
////	}
////	Date d(d1)
////private:
////	int _year;
////	int _month;
////	int _day;
////};
////
////int main()
////{
////1
////	Date d1(2024,10,10);
////	Date d2(d1);
////	Date d(d1);
////	return 0;
////}
//////bool operator==(Date& d1, Date& d2)
////{
////	return d1._year == d2._year
////		&& d1._month == d2._month
////		&& d1._day == d2._day;
////}
////int main()
////{
////	Date d1(2024, 7, 7);
////	Date d2(2024.7, 8);
////	if(d1	== d2)// 类/全局
////	if (d1.operator==(d2))//声明在类中
////	operator==(d1, d2);//声明在全局中
////	return 0;
////}
////#include<iostream>
////using namespace std;
////int main(int argc, char* argv[])
////{
////	string a = "hello world";
////	string b = a;
////	if (a.c_str() == b.c_str())
////	{
////		cout << "true" << endl;
////	}
////	else cout << "false" << endl;
////
////	string c = b;
////	c = "";
////	if (a.c_str() == b.c_str())
////	{
////		cout << "true" << endl;
////	}
////	else cout << "false" << endl;
////
////	a = "";
////	if (a.c_str() == b.c_str())
////	{
////		cout << "true" << endl;
////	}
////	else cout << "false" << endl;
////	return 0;
////}
////int main()
////{
////	//vector<int> v(5,2);
////	//vector<vector<int>> vv(10, v);
////
////	//cout<<vv[4][1];
////	cout << sizeof(int*);
////
////	return 0;
////}
////#include <iostream>
////using namespace std;
////int Getmonthday(int year, int month)
////{
////    static int monthday[13] = { 0,31,28,31,30,31,30,31,31,30,31,30,31 };
////    int day1 = monthday[month];
////    if (month == 2 && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0))
////        day1++;
////    return day1;
////}
////int main() {
////    int m;
////    int year = 0, month=0, day=0, n=0;
////    cin >> m;
////    while (m--)
////    {
////        cin >> year >> month >> day >> n;
////        day += n;
////        while(day > Getmonthday(year, month))
////        {
////            int day2 = Getmonthday(year, month);
////            day -= day2;
////            month++;
////            if (month >= 13)
////            {
////                year++;
////                month = 1;
////            }
////        }
////        printf("%04d-%02d-%02d\n", year, month, day);
////    }
////   
////    return 0;
////}
////#include<vector>
////#include<string>
////#include <iostream>
////using namespace std;
////
//// string addStrings(string num1, string num2) {
////        int i = num1.size() - 1, j = num2.size() - 1;
////        int next = 0;
////        string s = "";
////        while (i >= 0 || j >= 0 || next != 0)
////        {
////            int x = i >= 0 ? num1[i] - '0' : 0;
////            int y = j >= 0 ? num2[j] - '0' : 0;
////            int sum = x + y + next;
////            s.push_back('0' + sum % 10);
////            next = sum / 10;
////            i--;
////            j--;
////        }
////        reverse(s.begin(), s.end());
////        return s;
////   }
//// void reverseString(vector<char>& s) {
////     int n = s.size();
////     for (int left = 0, right = n - 1; left < right; ++left, --right) {
////         swap(s[left], s[right]);
////     }
//// }
////int main()
////{
////    //string s1("12 3");
////    //string s2("12");
////    //addStrings(s1, s2);
////    vector<char> v1;
////    v1.push_back('h');
////    v1.push_back('b');
////    v1.push_back('s');
////    v1.push_back('a');
////    return 0;
////}
////#include <iostream>
////#include <string>
////using namespace std;
////
////int main() {
////    string  s1;
////
////    getline(cin,s1);
////    string good("");
////    string::reverse_iterator rit = s1.rbegin();
////    while (rit != s1.rend())
////    {
////        if (*rit != ' ')
////        {
////            good += *rit;
////        }
////        break;
////    }
////    reverse(good.begin(), good.end());
////    cout << good.size();
////    return 0;
////}
//
////void func(char* p) { p = p + 1; }int main()
////{
////	char s[] = { '1', '2', '3', '4' }; func(s);
////	printf("%c", *s);
////	return 0;
////}
////#include<iostream>
////template<class T1, class T2>
////class Data
////{
////public:
////	Data() { cout << "Data<T1, T2>" << endl; }
////private:
////	T1 _d1;
////	T2 _d2;
////};
////template <class T1>
////class Data<T1, int>
////{
////public:
////	Data() { cout << "Data<T1, int>" << endl; }
////private:
////	T1 _d1;
////	int _d2;
////};
////template <typename T1, typename T2>
////class Data <T1*, T2*>
////{
////public:
////	Data() { cout << "Data<T1*, T2*>" << endl; }
////private:
////	T1 _d1;
////	T2 _d2;
////};
////template <typename T1, typename T2>
////class Data <T1&, T2&>
////{
////public:
////	Data(const T1& d1, const T2& d2)
////		: _d1(d1)
////	, _d2(d2)
////	{
////		cout << "Data<T1&, T2&>" << endl;
////	}
////private:
////	const T1& _d1;
////	const T2& _d2;
////};
////int main()
////{
////	Data<double, int> d1;
////	Data<int, double> d2;
////	Data<int*, int*> d3;
////	Data<int&, int&> d4(1, 2);
////	return 0;
////}
////using namespace std;
////template<class Type>
////Type Max(const Type& a, const Type& b)
////{
////	cout << "This is Max<Type>" << endl;
////	return a > b ? a : b;
////}
////template<>
////int Max<int>(const int& a, const int& b)
////{
////	cout << "This is Max<int>" << endl;
////	return a > b ? a : b;
////}
////template<>
////char Max<char>(const char& a, const char& b)
////{
////	cout << "This is Max<char>" << endl;
////	return a > b ? a : b;
////}
////int Max(const int& a, const int& b)
////{
////	cout << "This is Max" << endl;
////	return a > b ? a : b;
////}
////int main()
////{
////	Max(10, 20);
////	Max(12.34, 23.45);
////	Max('A', 'B');
////	Max<int>(20, 30);
////	return 0;
////}
////
